Data analysis expressions

ABSTRACT

Methods and systems are disclosed for receiving and processing data analysis expressions. A particular method includes receiving a data analysis expression at a pivot table of a spreadsheet. The data analysis expression is executed for a particular cell of the pivot table by determining a context associated with the particular cell, calculating a value of the data analysis expression based on the context, and outputting the calculated value at the particular cell.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of continuation of U.S. patentapplication Ser. No. 14/997,138, filed Jan. 15, 2016, and titled “DataAnalysis Expressions,”which is a continuation of U.S. patent applicationSer. No. 12/576,254, filed Oct. 9, 2009, and titled “Data AnalysisExpressions,” the entirety of both are hereby incorporated by reference.

BACKGROUND

Multi-dimensional data analysis (e.g., viewing and analyzing data frommultiple perspectives) has become increasingly popular with businesses.However, current multi-dimensional data analysis applications typicallyrequire users to be proficient in complex semantic languages such asMulti-Dimensional Expression Language (MDX), because MDX expressions areused to organize and analyze the data. Thus, it may be difficult forbusiness employees untrained in MDX to perform multi-dimensional dataanalysis. Furthermore, although business employees may be familiar withdata analysis formulae provided by commonly available spreadsheetapplications, such formulae are usually not as powerful asmulti-dimensional data analysis programs. For example, such formulae mayonly enable a one-dimensional (e.g., sequential) aggregation of data.Therefore, a business that makes decisions based on multiple factors maybe faced with a choice between two expensive alternatives: trainexisting employees in complex languages such as MDX or hire analyststhat specialize in multi-dimensional data analysis.

SUMMARY

Systems and methods of receiving and processing data analysisexpressions (DAXs) are disclosed. A DAX may be defined in an expressionlanguage similar to spreadsheet formulae and may operate on aspreadsheet table to perform multi-dimensional data analysis and dataanalysis with respect to relational data models. Thus, DAXs may empowerpeople familiar with existing spreadsheet applications to performmulti-dimensional data analysis and data analysis with respect torelational data models (e.g., within existing spreadsheet applications).Unlike conventional spreadsheet formulae, a DAX beneficially isindependent of particular cell ranges of the spreadsheet.

For example, a DAX may be received and executed at a pivot table of aspreadsheet application. Executing the DAX for a particular cell of thepivot table may include determining a context for the particular cell,calculating the value of the DAX for the particular cell, and outputtingthe calculated value of the DAX at the particular cell.

DAXs may support multi-table execution. For example, a DAX may refer toa first data table and a second data table, and executing the DAX mayinclude traversing a relationship between the first data table and thesecond data table (e.g., following a relationship that may exist betweena column in a first table and a column in a second table). DAXs may alsosupport dynamic re-execution. For example, a DAX may be automaticallyre-executed with respect to a set of rows of a data table in response toa user modification to data stored in the set of rows.

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram to illustrate a particular embodiment of acomputer system to receive and process data analysis expressions;

FIG. 2 is a block diagram to illustrate another particular embodiment ofa computer system to receive and process data analysis expressions;

FIG. 3 illustrates a particular embodiment of a data table useable bythe system of FIG. 1;

FIG. 4 illustrates a particular embodiment of a pivot table based on thedata table of FIG. 3;

FIG. 5 illustrates another particular embodiment of a data table useableby the system of FIG. 1;

FIG. 6 illustrates a particular embodiment of a pivot table based on thedata table of FIG. 3 and the data table of FIG. 5;

FIG. 7 is a flow diagram to illustrate a particular embodiment of amethod of receiving and processing data analysis expressions;

FIG. 8 is a flow diagram to illustrate another particular embodiment ofa method of receiving and processing data analysis expressions;

FIG. 9 is a flow diagram to illustrate another particular embodiment ofa method of receiving and processing data analysis expressions; and

FIG. 10 is a block diagram of a computing environment including acomputing device operable to support embodiments of computer-implementedmethods, computer program products, and system components as illustratedin FIGS. 1-9.

DETAILED DESCRIPTION

Data analysis expressions (DAXs) may enable multi-dimensional dataanalysis at conventional data processing application, such as aspreadsheet application. For example, a DAX may be received as a columndefinition for a column of a spreadsheet table or as a measure at apivot table. The DAX may be executed to populate the column, where thevalue in each cell is calculated based on a row context for that cell.Alternately, cells of the pivot table may be populated by executing theDAX, where the value in each cell of the pivot table is calculated basedon a context (e.g., a filter context) associated with that cell.

In a particular embodiment, a computer-implemented method is disclosedthat includes receiving a data analysis expression at a pivot table of aspreadsheet. The computer implemented method also includes executing thedata analysis expression with respect to at least one data table of thespreadsheet. Executing the data analysis expression for a particularcell of the pivot table may be performed by determining a contextassociated with the particular cell, calculating a value of the dataanalysis expression based on the context, and outputting the calculatedvalue at the cell.

In another particular embodiment, a computer-readable medium isdisclosed that includes instructions, that when executed by a processor,cause the processor to receive input including a column definition of aparticular column of a first spreadsheet table. The input includes adata analysis expression based on at least one column of the spreadsheettable and based on at least one column of a second spreadsheet table.The computer-readable medium includes instructions, that when executedby the processor, cause the processor to determine a relationshipbetween the first spreadsheet table and the second spreadsheet table andto populate the particular column by executing the data analysisexpression. Executing the data analysis expression for a particular rowof the first spreadsheet table includes calculating a value of the dataanalysis expression based on first data in the particular row of thefirst spreadsheet table and second data retrieved from the secondspreadsheet table based on a row context associated with the particularrow. Executing the data analysis expression also includes outputting thecalculated value at cell that is a member of the particular column andthe particular row.

In another particular embodiment, a system is disclosed. The systemincludes a memory and a data interface configured to receive data, tocreate one or more data tables based on the received data, and to storethe data tables in a column-based in-memory store (e.g., a structurethat maps to an online analytical processing (OLAP) cube structure). Thesystem also includes a pivot table module configured to generate a pivottable based on the data table(s). The system further includes ananalysis module configured to receive a data analysis expression andexecute the data analysis expression with respect to at least one columnof the data table(s). Executing the data analysis expression for aparticular cell of the pivot table includes determining a filter contextassociated with the particular cell and retrieving data associated withone or more rows of the data table corresponding to the filter contextof the particular cell. Executing the data analysis expression alsoincludes calculating a value of the data analysis expression based onthe retrieved data and outputting the calculated value at the cell.

FIG. 1 is a block diagram to illustrate a particular embodiment of acomputer system 100 to receive and process data analysis expressions(DAXs). The computer system 100 includes a data interface 110 and amemory 114. The computer system 100 includes a spreadsheet analysismodule 126 and a spreadsheet pivot table module 118. Generally, thecomputer system 100 may receive and process DAXs, such as anillustrative DAX 104. The DAXs may have syntax similar to existingspreadsheet formulae and may enable multi-dimensional (e.g. multi-tableand/or multi-column) data analysis at the computer system 100.

The computer system 100 includes the data interface 110 that isconfigured to receive data 102. In a particular embodiment, the data 102is provided by a user of the computer system 100. Alternately, the data102 may be received from another computer system, a network storagedevice, or a network share. The data interface 110 is further configuredto create a data table 112 based on the received data at a memory 114using an in-memory column-based store. For example, the data interface110 may create a table within a spreadsheet application (e.g., aspreadsheet table), where the table includes the data 102. An onlineanalytical processing (OLAP) cube 116 data structure may be constructedat the memory 114 based on the in-memory column-based store. An OLAPcube may store data arranged such that each of the three dimensions(i.e., axes) of the OLAP cube provide a different arrangement of thedata. For example, an OLAP cube may structure sales data arranged bydate, product identifier, and customer identifier, as further describedherein with reference to FIGS. 3-6. Alternately, the data table 112 maybe stored in another data structure, such as an OLAP hypercube (e.g., anOLAP data structure having more than three dimensions) or some otherin-memory column store. Storage of the data table 112 in the OLAP cube116 at the memory 114 (e.g., random access memory (RAM) of the computersystem 100) may help in facilitating multi-dimensional data analysis andpivot table operations as described herein. Data tables are furtherdescribed herein with respect to FIGS. 3 and 5.

The computer system 100 also includes a spreadsheet pivot table module118. In an illustrative embodiment, the spreadsheet pivot table module118 is part of a spreadsheet application of the computer system 100. Thespreadsheet pivot table module 118 includes logic 120 to generate apivot table 122 based on the data table 112 referenced by the OLAP cube116. The pivot table 122 may support “pivot” operations, where rowheaders, column headers, filters, or slicers of the pivot table 122 arechanged and data values in the pivot table 122 are automatically updatedto reflect the changes. In a particular embodiment, updating the pivottable 122 in response to a pivot operation includes re-executing a queryof the in-memory OLAP cube 116, so that data from the OLAP cube isarranged and viewed along different dimensions of the OLAP cube. Pivottables are further described herein with reference to FIGS. 4 and 6.

The computer system 100 further includes a spreadsheet analysis module126. In an illustrative embodiment, the spreadsheet analysis module 126is part of a spreadsheet application of the computer system 100. Thespreadsheet analysis module 126 is configured to receive the DAX 104 andincludes DAX execution logic 128 configured to execute the DAX 104. Forexample, the spreadsheet analysis module 126 may execute the DAX 104with respect to the data table 112. Executing the DAX for a particularcell of the pivot table 122 includes determining a filter context forthe particular cell as well as the row context(s) for tables referencedby the DAX 104, retrieving data 124 based on the row context(s) (e.g.,data associated with one or more rows of the data table 112) from theOLAP cube 116, calculating a value 130 of the DAX 104 based on theretrieved data, and outputting the calculated value 130 at the cell ofthe pivot table. Thus, populating the pivot table 122 may includeautomatic recursive executions of the DAX 104 with respect to differentcontexts and cross-filtering of multiple data tables. Alternately,calculations may be performed in a block mode, so that calculations formultiple cells of the pivot table may be performed simultaneously.

In a particular embodiment, the DAX 104 includes a formula to beaggregated over multiple rows of the data table 112. The formula may bea user-defined formula expressed in a native formula language of aspreadsheet application that includes the modules 118, 126, withoutreferring to specific cell ranges of the spreadsheet application. Thus,DAXs (e.g., the DAX 104) may enable table-based (e.g., column based)multi-dimensional data analysis (as opposed to conventional spreadsheetcell-based analysis) while incorporating existing spreadsheet formulaethat users are familiar with. For example, the DAX 104 may includeaggregations (e.g., sum, average, minimum, maximum, or count),time-based functions (e.g., days, weeks, months, quarters, years, firstand last date, first and last non blank date, start and end ofmonth/quarter/year, dateadd, datesbetween, datesinperiod,parallelperiod, previous day/month/quarter/year, nextday/month/quarter/year, month/quarter/years dates to current date,sameperiodlastyear, aggregateover month/quarter/year, or opening andclosing monthly/quarterly/yearly balance), or any combination thereof.The DAX may further include apply functions, groupby functions, semijoinfunctions, lookupvalues functions, earlier/earliest functions (e.g., torefer to a previous value at a cell), intersect functions, exceptfunctions, union functions, select functions, join functions, topNfunctions, rank functions, or any combination thereof. The DAX 104 mayalso include specialized table-based functions having syntax similar tocommonly used spreadsheet formulae. For example, the DAX 104 may includea related table function, a relatedtable table function, a filter tablefunction, a distinct table function, a values table function, an alltable function, an allexcept table function, an allnoblankrow tablefunction, or any combination thereof.

In operation, the data table 112 may be created based on the data 102received by the data interface 110. It should be noted that operationwith respect to a single data table 112 is provided for illustrativepurposes only. There may be any number of data tables and data sources.The data table 112 may be used as a data source for the OLAP cube 116 inthe memory 114. A spreadsheet application user may desire to performanalysis on the data table 112 through the use of a pivot table 122. Thepivot table 122 may be generated by the spreadsheet pivot table module118. In defining measures output by the pivot table 122, the user mayinput a DAX 104. The spreadsheet analysis module 126 may populate thecells of the pivot table 122 by executing the DAX 104. Populating aparticular cell of the pivot table 122 may include determining a filtercontext associated with the particular cell, calculating the DAX value130 for the particular cell based on the context, and outputting thecalculated DAX value 130 at the cell.

In a particular embodiment, execution of DAXs involves a hybriditerator-based and lookup-based execution strategy. In anotherparticular embodiment, executing a DAX may include cross-application ofa canonical form (e.g., a non-relational algebra form) of an executiontree for the DAX. In another particular embodiment, DAX execution mayinclude dependency analysis to determine what sub-calculations acalculated column depends on. Based on the dependency analysis, an orderfor calculating the sub-calculations may be determined. For example, ifthe value A in a calculated column depends on the results of threesub-calculations B, C, and D, then a rule may be generated that resultsin the calculation of each of B, C, and D before an attempt to calculateA.

It should be noted that although the particular embodiment illustratedin FIG. 1 depicts the use of DAXs in pivot tables, DAXs may also be usedwithout pivot tables. For example, the DAX 104 may be entered at aspreadsheet application as a column definition of a particular column ofthe data table 112. The DAX 104 may be based on one or more columns ofthe data table 112 (and possibly additional tables) other than theparticular column. Populating a cell of the particular column mayinclude determining a row context for the cell, calculating a value ofthe DAX 104 based on the row context, and outputting the calculatedvalue for the DAX 104 at the cell. In another embodiment, the DAX 104may additionally be based on at least one column of a second data table.In such an embodiment, calculating a value for the DAX may includeretrieving data from the second data table based on a relationshipbetween the data table 112 and the second data table. For example, thedata table 112 may include a column containing a value that may be foundin a related column (e.g., an index column) of the second data table. Ina particular embodiment, the second data table is involved in thecalculation even when no relationship exists. For example, executing theDAX 104 may include filtering the second data table to include rows thatpertain to data values in the data table 112. The resulting filteredrows may then be aggregated by the DAX. It should be noted that therelationship (e.g., related column) between the data table 112 and thesecond data table may exist even when the related column has a differentname in the data table 112 than in the second data table. Relationshipsbetween data tables are further described with respect to FIGS. 5-6.

It will be appreciated that the system 100 of FIG. 1 may enable, viaDAXs, advanced data analysis not enabled by generic spreadsheetformulae. It will further be appreciated that the system 100 of FIG. 1may enable such advanced analysis based on multiple tables withoutreferences to particular cell ranges of a spreadsheet.

FIG. 2 is a block diagram to illustrate another particular embodiment ofa computer system 100 to receive and process DAXs. The system 200includes a spreadsheet application 210 configured to receive user input202. The spreadsheet application 210 also includes an analysis module220. In an illustrative non-limiting embodiment, the analysis module 220is the spreadsheet analysis module 126 of FIG. 1 and includes DAXexecution logic 222 similar to the DAX execution logic 128 of FIG. 1.

The spreadsheet application 210 may include logic 204 configured toreceive a query 201 in response to a change at a pivot table at thespreadsheet application 210. For example, the logic 204 may receive thequery 201 in response to a user changing a setting at the pivot table122 of FIG. 1. In response to receiving the query 201, the logic 204 mayautomatically generate a command 208 to recalculate a DAX associatedwith the pivot table and send the command 208 to the analysis module220.

The spreadsheet application 210 may include logic 206 configured todetect changes in one or more data tables at the spreadsheet application210. For example, the logic 206 may be configured to detect changes at adata table such as the pivot table 112 of FIG. 1. The changes may bedetected based on user input 202. For example, the user input 202 mayinclude a new value for a cell of the data table. In response todetecting changes in the data table(s), the logic 206 may automaticallygenerate the command 208 to recalculate a DAX (e.g., a column definitionDAX) associated with the changed data table(s) and send the command 208to the analysis module 220.

In response to receiving the command 208, the analysis module 220 mayautomatically recalculate one or more DAXs at the spreadsheetapplication. For example, the analysis module 220 may automaticallyrecalculate column definition DAXs at data tables of the spreadsheetapplication 210, DAXs at a pivot table of the spreadsheet application210, or any combination thereof.

It will be appreciated that the system 200 of FIG. 2 may improve userexperience at the spreadsheet application 210 by enabling automaticrecalculation of DAXs. Thus, users of the spreadsheet application maymake changes to data tables and pivot tables and observe correspondingchanges in DAX values without redefining and manually re-executing theDAXs. It will therefore be appreciated that once entered, a DAX may beused to perform multi-dimensional data analysis multiple times withrespect to changing data.

FIGS. 3-4 illustrate a particular embodiment of the data table 112 ofFIG. 1 (illustrated as a sales table 300) and a pivot table 400generated based on the sales table 300. The sales table 300 includes oneor more rows 310 and columns 320, 330, 340, 350, 360, and 370. In anillustrative embodiment, the sales table 300 includes the data table 112of FIG. 1.

Each of the rows 310 of the sales table 300 may represent a salestransaction and each column 320-370 of the sales table 300 may representdata associated with a sales transaction. For example, the column 320may represent a date of a particular sale, the column 330 may representa customer identifier (CustID) indicating which customer paid for theparticular sale, the column 340 may represent a product identifier(ProdID) indicating which product was paid for, the column 350 mayrepresent a quantity of products sold, the column 360 may represent aprice charged for each of the products sold, and the column 370 mayrepresent a total amount 370 generated by sale. In a particularembodiment, the amount column 370 is defined by a spreadsheet formula(e.g., “=Qty*Price”). The sales table 300 further includes a static sumaggregation 380 for the amount column 370.

It should be noted that column references included in a DAX may bepolymorphic. That is, a column reference in a DAX may resolve to acolumn when used in a column calculation and may resolve to a valuestored at a particular row of the column when used in a scalarcalculation. For example, when used in a column calculation, the columnreference “Amount” may resolve to the column 370, but when used in ascalar calculation the reference “Amount” may resolve to the value ofQty*Price stored at a particular row of the rows 310 of FIG. 3. Itshould also be noted that a DAX, or a part thereof, may includefunctions or formulae that may result in a table useable as anintermediate result of a scalar calculation.

In the particular embodiment illustrated in FIG. 4, the pivot table 400pivots on the data column 320 and a combination of the ProdID column 340and the CustID column 330 of the sales table 300 of FIG. 3. That is, thepivot table 400 may aggregate data based on date and ProdID/CustIDcontexts from the sales table 300 of FIG. 3. For example, a DAX 410“SUM[Amount]” may be received at the pivot table 400, indicating adesire that the cells of the pivot table 400 contain a sum aggregationof the amount column 370 of FIG. 3 for various combinations (i.e.,contexts) of date, ProdID, and CustID of the sales table 300 of FIG. 3.Accordingly, a first illustrative cell 412 of the pivot table 400indicates an amount received from selling “456Red” products during 2009regardless of customer and a second illustrative cell 414 indicates anamount received from selling “789Green” products to customer “Jon200”during 2008. That is, a first context associated with the first cell 412may be “Time[Year]=2009; Product[ProdID]=‘456Red’” and a second contextassociated with the second cell 414 may be “Time[Year]=2008;Product[ProdID]=‘789Green’; Customer[CustID]=‘Jon200’.”

It should be noted that contexts may also include inequalities. Forexample, products purchased by the customer “Jon200” that cost more than$200 may be determined using the context “Customer[CustID]=‘Jon200’;Product[Price]>200.00”.

It should also be noted that the pivot table 400 may also be generatedusing a different DAX than the DAX 410. For example, if the amountcolumn 370 of FIG. 3 did not exist, the pivot table 400 may be generatedby incorporating the “=Qty*Price” formula of the amount column 370 intothe DAX 410. For example, the DAX 410 may be “SUM[Qty*Price].”

It will be appreciated that multiple cells of the pivot table 400 ofFIG. 4 may be populated based on contexts associated with the salestable 300 of FIG. 3 without entering the DAX 410 of FIG. 4 multipletimes. Instead, the DAX 410 of FIG. 4 may be automatically recursivelyre-executed for each cell of the pivot table 400 of FIG. 4 based on adifferent context associated with each cell of the pivot table 400 ofFIG. 4. It will further be appreciated that the static sum aggregation380 may indicate a total of all products sold, but the DAX 410 mayinstead be used to provide a multi-dimensional view of the products sold(e.g., total by product, total by year, and total by combination ofproduct and year).

FIGS. 5-6 illustrate another particular embodiment of the data table 112of FIG. 1 (illustrated as an inventory table 500) and a pivot table 600based on the data tables of FIG. 3 and FIG. 5 (e.g., the sales table 300of FIG. 3 and the inventory table 500 of FIG. 5). Each of the rows 510of the inventory table 500 may represent a particular product availablefor sale and columns 520-540 may represent data associated with theparticular product. For example, the column 520 may represent a productidentifier (ProdID) of the particular product, the column 530 mayrepresent a description of the particular product, and the column 540may represent how many units of the particular product are currentlyin-stock.

One or more columns of the inventory table 500 may also include a DAXcolumn definition. For example, the units sold column 550 has anassociated DAX column definition “SUM[Qty]” 560. Rows of the units soldcolumn 550 may be populated by aggregating the Qty column 350 of FIG. 3for various products. For example, the cell 552 may be populated byfiltering the sales table 300 of FIG. 3 for rows that have a ProdID of‘789Green’ and then aggregating the Qty column of rows that remain. Itwill be appreciated that to populate the cell 552, a relationship (e.g.,a previously user-defined relationship) between the sales table 300 ofFIG. 3 and the inventory table 500 of FIG. 5 (e.g., that the ProdIDcolumns 370 of FIG. 3 and 520 of FIG. 5 are related) may automaticallybe identified and traversed. It should be noted that filtering a table(e.g., the sales table 300 of FIG. 3) may include Boolean filters aswell as table-based filters.

The pivot table 600 may pivot on columns of multiple data tables. In theparticular embodiment illustrated in FIG. 6, the pivot table 600 pivotsthe date column 320 of FIG. 3 and a combination of the descriptioncolumn 530 of FIG. 5 and CustID column 330 of FIG. 300. That is,although the pivot table 600 aggregates data from one table, the salestable 300 of FIG. 3, the aggregation may be based on contexts from boththe sales table 300 of FIG. 3 and the inventory table 500 of FIG. 5.

The pivot table 600 may receive a DAX 610 “SUM[Amount]” similar to theDAX 410 of FIG. 4, and the value of the DAX 610 may be recursivelycalculated to populate cells of the pivot table 600. Populating thepivot table 600 may include identifying a relationship between the salestable 300 of FIG. 3 and the inventory table 500 of FIG. 5 and retrievingdata from both the sales table 300 of FIG. 3 and the inventory table 500of FIG. 5. For example, in the particular embodiment illustrated in FIG.6, a relationship between the tables 300 of FIG. 3 and 500 of FIG. 5 mayautomatically be identified. The relationship may include the relatedcolumns 340 of FIG. 3 and 520 of FIG. 5, both of which are productidentifier (ProdID) columns. In a particular embodiment, the relatedcolumns are index columns. Thus, a row header 612 “Blue Bike” of thepivot table 600 may be populated based on the identified relationshipbetween the sales table 300 of FIG. 3 and the inventory table 500 ofFIG. 5. A first illustrative cell 614 of the pivot table 600 may beassociated with a first context “Time[Year]=2009;Product[Description]=‘Red Bike’ and a second illustrative cell 616 ofthe pivot table 600 may be associated with a second context“Time[Year]=2008; Product[Description]=‘Green Trike’;Customer[CustID]=‘Jon200’.”

It will thus be appreciated that DAXs (e.g., the DAXs 560 of FIG. 5 and610 of FIG. 6) may enable multi-dimensional data analysis acrossmultiple tables (e.g., the sales table 300 of FIG. 3 and the inventorytable 500 of FIG. 5). It will further be appreciated that suchmulti-dimensional data analysis may occur at the tables themselves(e.g., at the column 550 of FIG. 5) as well as at a pivot table (e.g.,the pivot table 600 of FIG. 6).

FIG. 7 is a flow diagram to illustrate a particular embodiment of amethod 700 of receiving and processing data analysis expressions. In anillustrative embodiment, the method 700 may be performed by the system100 of FIG. 1.

The method 700 includes receiving a DAX at a pivot table of aspreadsheet, at 702. For example, in FIG. 1, the DAX 104 may be receivedat the pivot table 122. To illustrate, referring to FIG. 4, the DAX maybe the DAX “SUM[Amount]” 410.

The method 700 also includes executing the DAX, at 704. For example, inFIG. 1, the spreadsheet analysis module 126 may execute the DAX 104.With respect to a particular cell of the pivot table, executing the DAXincludes determining a context associated with the particular cell, at706, calculating a value of the DAX based on the context, at 708, andoutputting the calculated value at the particular cell, at 710. Forexample, in FIG. 1, a context may be determined, the data 124 based onthe context may be retrieved, and the DAX value 130 may be calculatedand output at the particular cell of the pivot table 122. To illustrate,referring to FIG. 4, the particular cell may be the cell 414 of FIG. 4,the context may be “Time[Year]=2008; Product[ProdID]=‘789Green’;Customer[CustID]=‘Jon200’,” and the calculated value of the DAX outputat the cell 414 may be “$1,500.”

FIG. 8 is a flow diagram to illustrate another particular embodiment ofa method 800 of receiving and processing data analysis expressions. Inan illustrative embodiment, the method 800 may be performed by thesystem 100 of FIG. 1 or by the system 200 of FIG. 2.

The method 800 includes receiving a DAX at a pivot table of aspreadsheet, at 802. The DAX includes a user-defined formula expressedin a native formula language of the spreadsheet (e.g., the DAX mayinclude existing spreadsheet functions and may include syntax similar toexisting spreadsheet functions). For example, in FIG. 1, the DAX 104 maybe received at the pivot table 122.

The method 800 also includes executing the DAX, at 804. For example, inFIG. 1, the spreadsheet analysis module 126 may execute the DAX 104.With respect to a particular cell of the pivot table, executing the DAX104 includes determining a context associated with the particular cell,including filtering the at least one data table based on the particularcell, at 806. Executing the DAX 104 also includes calculating a value ofthe DAX 104 based on the context, at 808, and outputting the calculatedvalue at the particular cell, at 810. For example, in FIG. 1, a contextmay be determined, the data table 112 may be filtered based on thecontext (e.g., rows that do not match the context may temporarily behidden or ignored), the data based on the context 124 may be retrieved,and the DAX value 130 may be calculated and output at the particularcell of the pivot table 122.

The method 800 further includes receiving a query in response to achange at the pivot table, at 812, or detecting a change at the at leastone data table, at 814. For example, in FIG. 1, a pivot operation of thepivot table 122 may occur or a change in the data table 112 may bedetected. In an illustrative embodiment, the query is received asdescribed herein with respect to the logic 204 of FIG. 2 and the changeat the at least one data table is detected as described herein withrespect to the logic 206 of FIG. 2.

The method 800 includes automatically re-executing the DAX 104, at 816,by returning to 806. For example, in FIG. 1, the spreadsheet analysismodule 126 may automatically re-execute the DAX 104. In an illustrativeembodiment, the automatic re-execution of the DAX 104 is performed asdescribed herein with respect to the command 208 and the module 220 ofFIG. 2.

FIG. 9 is a flow diagram to illustrate another particular embodiment ofa method 900 of receiving and processing data analysis expressions. Inan illustrative embodiment, the method 900 may be performed by thesystem 100 of FIG. 1.

The method 900 includes receiving input including a column definition ofa particular column of a first spreadsheet table, at 902. The inputincludes a DAX based on at least one column of the first spreadsheettable and based on at least one column of a second spreadsheet table.For example, referring to FIG. 5, the DAX “SUM[Qty]” 560 may be receivedas a column definition for the column 550, where the DAX 560 refers toboth the sales table 300 of FIG. 3 and the inventory table 500 of FIG.5.

The method 900 also includes determining a relationship between thefirst spreadsheet table and the second spreadsheet table based on theDAX, at 904. In a particular embodiment, the relationship is a relatedcolumn, an index column, or a column having different names in the twospreadsheet tables. For example, a relationship between the sales table300 of FIG. 3 and the inventory table 500 of FIG. 5 may be identified,such as identifying the ProdID columns 340 of FIG. 3 and 520 of FIG. 5as related columns.

The method 900 further includes populating the particular column byexecuting the DAX, at 906. Executing the DAX for a particular row of thefirst spreadsheet table includes calculating a value of the DAX, at 908,and outputting the calculated value at a cell that is a member of theparticular row and the particular column, at 910. The value iscalculated based on first data in the particular row of the firstspreadsheet table and based on second data retrieved from the secondtable based on a row context associated with the particular row. Forexample, referring to FIG. 5, the cell 552 may be populated byaggregating rows of the sales table 300 matching the row context“Product[ProdID]=‘789Green’” and outputting the resulting value at thecell 552.

The method 900 includes receiving a selection of a subset of rows of thefirst spreadsheet table, at 912, and automatically re-executing the DAXfor the selected subset of rows, at 914, by returning to 908. Forexample, referring to FIG. 5, a selection of one or more of the rows 510may be received and the DAX 560 may be re-executed for the selectedrows.

FIG. 10 depicts a block diagram of a computing environment 1000including a computing device 1010 operable to support embodiments ofcomputer-implemented methods, computer program products, and systemcomponents according to the present disclosure. In an illustrativeembodiment, the computing device 1010 may include the data interface 110of FIG. 1, the memory 114 of FIG. 1, the modules 118, 126 of FIG. 1, thelogic 204-206 of FIG. 2, or the module 220 of FIG. 2. Each of the datainterface 110 of FIG. 1, the memory 114 of FIG. 1, the modules 118, 126of FIG. 1, the logic 204-206 of FIG. 2, or the module 220 of FIG. 2 mayinclude the computing device 1010 or a portion thereof.

The computing device 1010 includes at least one processor 1020 andsystem memory 1030. Depending on the configuration and type of computingdevice, the system memory 1030 may be volatile (such as random accessmemory or “RAM”), non-volatile (such as read-only memory or “ROM,” flashmemory, and similar memory devices that maintain stored data even whenpower is not provided) or some combination of the two. The system memory1030 typically includes an operating system 1032, one or moreapplication platforms 1034, one or more applications (e.g., aspreadsheet application 1036), and may include program data associatedwith the one or more applications (e.g., an OLAP cube data structure1038). In an illustrative embodiment, the spreadsheet application 1036is the spreadsheet application 210 of FIG. 2 and the OLAP cube datastructure 1038 is the OLAP cube data structure 116 of FIG. 1. In anillustrative embodiment, the system memory 1030 may include one or morelogical components or modules as disclosed herein. For example, thesystem memory 1030 may include one or more of the modules 118, 126 ofFIG. 1, the logic 204-206 of FIG. 2, or the module 220 of FIG. 2.

The computing device 1010 may also have additional features orfunctionality. For example, the computing device 1010 may also includeremovable and/or non-removable additional data storage devices such asmagnetic disks, optical disks, tape, and standard-sized or miniatureflash memory cards. Such additional storage is illustrated in FIG. 10 byremovable storage 1040 and non-removable storage 1050. Computer storagemedia may include volatile and/or non-volatile storage and removableand/or non-removable media implemented in any method or technology forstorage of information such as computer-readable instructions, datastructures, program components or other data. The system memory 1030,the removable storage 1040 and the non-removable storage 1050 are allexamples of computer storage media. The computer storage media includes,but is not limited to, RAM, ROM, electrically erasable programmableread-only memory (EEPROM), flash memory or other memory technology,compact disks (CD), digital versatile disks (DVD) or other opticalstorage, magnetic cassettes, magnetic tape, magnetic disk storage orother magnetic storage devices, or any other medium that can be used tostore information and that can be accessed by the computing device 1010.Any such computer storage media may be part of the computing device1010. The computing device 1010 may also have input device(s) 1060, suchas a keyboard, mouse, pen, voice input device, touch input device, etc.Output device(s) 1070, such as a display, speakers, printer, etc. mayalso be included.

The computing device 1010 also contains one or more communicationconnections 1080 that allow the computing device 1010 to communicatewith other computing devices 1090 over a wired or a wireless network. Inan illustrative embodiment, the communication connections 1080 includethe data interface 110 of FIG. 1 and the data 102 of FIG. 1 is receivedfrom other computing devices 1090 such as a shared network storagedevice.

It will be appreciated that not all of the components or devicesillustrated in FIG. 10 or otherwise described in the previous paragraphsare necessary to support embodiments as herein described. For example,the input device(s) 1060 and output device(s) 1070 may be optional.

The illustrations of the embodiments described herein are intended toprovide a general understanding of the structure of the variousembodiments. The illustrations are not intended to serve as a completedescription of all of the elements and features of apparatus and systemsthat utilize the structures or methods described herein. Many otherembodiments may be apparent to those of skill in the art upon reviewingthe disclosure. Other embodiments may be utilized and derived from thedisclosure, such that structural and logical substitutions and changesmay be made without departing from the scope of the disclosure.Accordingly, the disclosure and the figures are to be regarded asillustrative rather than restrictive.

Those of skill would further appreciate that the various illustrativelogical blocks, configurations, modules, and process or instructionsteps described in connection with the embodiments disclosed herein maybe implemented as electronic hardware, computer software, orcombinations of both. Various illustrative components, blocks,configurations, modules, or steps have been described generally in termsof their functionality. Whether such functionality is implemented ashardware or software depends upon the particular application and designconstraints imposed on the overall system. Skilled artisans mayimplement the described functionality in varying ways for eachparticular application, but such implementation decisions should not beinterpreted as causing a departure from the scope of the presentdisclosure.

The steps of a method described in connection with the embodimentsdisclosed herein may be embodied directly in hardware, in a softwaremodule executed by a processor, or in a combination of the two. Asoftware module may reside in computer readable media, such as randomaccess memory (RAM), flash memory, read only memory (ROM), registers, ahard disk, a removable disk, a CD-ROM, or any other form of storagemedium known in the art. An exemplary storage medium is coupled to theprocessor such that the processor can read information from, and writeinformation to, the storage medium. In the alternative, the storagemedium may be integral to the processor or the processor and the storagemedium may reside as discrete components in a computing device orcomputer system.

Although specific embodiments have been illustrated and describedherein, it should be appreciated that any subsequent arrangementdesigned to achieve the same or similar purpose may be substituted forthe specific embodiments shown. This disclosure is intended to cover anyand all subsequent adaptations or variations of various embodiments.

The Abstract of the Disclosure is provided with the understanding thatit will not be used to interpret or limit the scope or meaning of theclaims. In addition, in the foregoing Detailed Description, variousfeatures may be grouped together or described in a single embodiment forthe purpose of streamlining the disclosure. This disclosure is not to beinterpreted as reflecting an intention that the claimed embodimentsrequire more features than are expressly recited in each claim. Rather,as the following claims reflect, inventive subject matter may bedirected to less than all of the features of any of the disclosedembodiments.

The previous description of the embodiments is provided to enable anyperson skilled in the art to make or use the embodiments. Variousmodifications to these embodiments will be readily apparent to thoseskilled in the art, and the generic principles defined herein may beapplied to other embodiments without departing from the scope of thedisclosure. Thus, the present disclosure is not intended to be limitedto the embodiments shown herein but is to be accorded the widest scopepossible consistent with the principles and novel features as defined bythe following claims.

What is claimed is:
 1. A computer-readable hardware storage medium storing instructions, that when executed by a processor, cause the processor to: receive input comprising a column definition of a particular column of a first table, wherein the input includes a data analysis expression based on at least one column of the first table other than the particular column and based on at least one column of a second table; determine a relationship between the first table and the second table based on the data analysis expression; and populate the particular column by executing the data analysis expression, wherein executing the data analysis expression for a particular row of the first table comprises: receiving a new value for a cell in the first table; generating a command to calculate a value of the data analysis expression based on the new value; calculating the value of the data analysis expression based on first data in the particular row of the first table and second data retrieved from the second table based on a filter context associated with the particular row; and outputting the calculated value at a cell, wherein the cell is a member of the particular column and the particular row.
 2. The computer-readable hardware storage medium of claim 1, further storing instructions, that when executed by the processor, cause the processor to: receive a selection of a subset of rows of the first table; and automatically re-execute the data analysis expression for the selected subset of rows.
 3. The computer-readable hardware storage medium of claim 1, wherein the data analysis expression includes a user-defined formula.
 4. The computer-readable hardware storage medium of claim 1, wherein the data analysis expression includes a formula to be aggregated over rows of at least one data table.
 5. The computer-readable hardware storage medium of claim 4, wherein the data analysis expression includes at least one aggregation selected from the group consisting of: a sum pivot table aggregation, an average pivot table aggregation, a minimum pivot table aggregation, a maximum pivot table aggregation, and a count pivot table aggregation, wherein the at least one aggregation may be performed for a plurality of expressions other than the data analysis expression.
 6. The computer-readable hardware storage medium of claim 1, wherein the relationship includes a related column that is an index column of the first table, an index column of the second table, or any combination thereof.
 7. A computer system comprising: one or more computing devices; memory storing one or more components, the one or more components comprising; a data interface component configured to receive data and to store the received data at a data table in a multi-dimensional cube data structure at the memory; a pivot table component configured to generate a pivot table based on the data table; an analysis component configured to: receive a data analysis expression; receive a user input associated with the multi-dimensional cube data structure; and execute the data analysis expression based on receiving the user input for a first cell and a second cell of the pivot table, wherein a first row context is associated with the first cell and a second row context is associated with the second cell, and wherein executing the data analysis expression for the first cell of the pivot table comprises: determining a first row context associated with the first cell; retrieving data associated with one or more rows of the pivot table corresponding to the first row context from the multi-dimensional cube data structure; calculating a value of the data analysis expression based on the retrieved data; and outputting the calculated value at the first cell.
 8. The computer system of claim 7, wherein the memory is a random access memory (RAM).
 9. The computer system of claim 7, wherein the multi-dimensional cube data structure is an online analytical processing (“OLAP”) cube data structure.
 10. The computer system of claim 7, wherein the data analysis expression includes a user-defined formula.
 11. The computer system of claim 7, further comprising automatically re-executing the data analysis expression in response to a pivot operation of the pivot table.
 12. The computer system of claim 7, wherein the data analysis expression includes a reference to a column of at least one data table, wherein the reference to the column resolves to the column when the reference is used in a column calculation, and wherein the reference to the column resolves to a value stored at a particular row of the column when the reference is used in a scalar calculation.
 13. The computer system of claim 7, wherein determining the context associated with the first cell includes filtering based on the first cell.
 14. A method executing on one or more processors, the method causing the one or more processors to: receive an input comprising a column definition of a particular column of a first table, wherein the input includes a data analysis expression based on at least one column of a second table from a first data structure and based on at least one column of a third table from a second data structure; determine a relationship between the second table and the third table; and populate the particular column of the first table by executing the data analysis expression, wherein executing the data analysis expression for a particular row of the first table comprises: receiving a user input; calculating a value of the data analysis expression based on the user input, wherein calculating the value based on the user input is based on first data retrieved from the second table and second data retrieved from the third table based on a filter context associated with the particular row; and outputting the calculated value at a cell, wherein the cell is a member of the particular column and the particular row of the first table.
 15. The method of claim 14 wherein the first data structure is an online analytical processing (“OLAP”) cube.
 16. The method of claim 14, wherein the method further causes the one or more processors to: receive a selection of a subset of the particular row of the first table; and automatically re-execute the data analysis expression for the subset of the particular row of the first table.
 17. The method of claim 14, wherein the data analysis expression includes a formula.
 18. The method of claim 17, wherein the data analysis expression includes a formula associated with at least one aggregation, wherein the at least one aggregation is selected from the group consisting of: a sum pivot table aggregation, an average pivot table aggregation, a minimum pivot table aggregation, a maximum pivot table aggregation, and a count pivot table aggregation.
 19. The method of claim 14, wherein the data analysis expression includes at least one time-based function from dateadd, datesbetween, datesinperiod, or parallelperiod.
 20. The method of claim 14, wherein the data analysis expression includes a related table function, a relatedtable table function, a filter table function, a distinct table function, a values table function, an all table function, an allexcept table function, an allnoblankrow table function, or any combination thereof. 